package com.tms.springboot.controller;


import com.tms.springboot.oms.pojo.PdOrder;
import com.tms.springboot.result.JsonResult;
import com.tms.springboot.result.ResultCode;
import com.tms.springboot.result.ResultTool;
import com.tms.springboot.service.PdTaskPickupDispatchService;
import com.tms.springboot.utils.UUId;
import com.tms.springboot.work.pojo.PdTaskPickupDispatch;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 取件、派件任务信息表 前端控制器
 * </p>
 *
 * @author cjj
 * @since 2023-06-14
 */
@RestController
@RequestMapping("/pd-task-pickup-dispatch")
public class PdTaskPickupDispatchController {
    @Autowired
    PdTaskPickupDispatchService pdTaskPickupDispatchService;

    @RequestMapping("/addPdTask")
    public JsonResult addPdTask(@RequestBody PdTaskPickupDispatch pdTaskPickupDispatch) {
        pdTaskPickupDispatch.setId(UUId.nextId());
        Boolean sum=pdTaskPickupDispatchService.save(pdTaskPickupDispatch);
        if (sum) {
            return ResultTool.success(ResultCode.SUCCESS);
        }
        return ResultTool.fail(ResultCode.COMMON_FAIL);
    }
}
